home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / HDS 3.02 / HDS / hds.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-09  |  2.8 KB  |  128 lines  |  [TEXT/MPS ]

  1. /* header file for hds */
  2.  
  3. #define MAXFNAME    20
  4. #define MAXFIELD    20
  5. #define MAXSLEN     1024
  6. #define MAXSLENG    ( MAXSLEN + 2*sizeof(short) ) /* add 4 for length & terminator */
  7.  
  8. #define READ_ONLY   1
  9.  
  10. #define EMERGENCY    (4096)
  11.  
  12. #define NOT_PROTECTED    0
  13. #define PROTECTED        1
  14.  
  15. /* file type for Mac dbs */
  16.  
  17. #define FTYPE        'HDDB'
  18.  
  19. /* security codes */
  20.  
  21. #define SEC_ON     -1
  22. #define SEC_OFF     0
  23.  
  24. /* record types */
  25.  
  26. #define ILLEGAL_REC             0
  27. #define NORMAL_REC              1
  28. #define DATA_REC                2
  29. #define DESCR_REC               3
  30. #define DESCRGD_REC                4
  31.  
  32. /* field types */
  33.  
  34. #define ILLEGA_F                0
  35. #define WORD_F                  1
  36. #define LONG_F                  2
  37. #define FLOAT_F                 3
  38. #define DOUBLE_F                4
  39. #define PTR_F                   5
  40. #define STRING_F                6
  41. #define MARK_F                  7
  42.  
  43. #define FIXED_STRING            -
  44.  
  45. /* Function indices for hdsnext */
  46.  
  47. #define THIS_RECORD                0
  48. #define ENTER_DATA                1
  49. #define BEFORE_RIGHT            2
  50. #define BEFORE_DOWN                3
  51. #define BEFORE_LEFT                4
  52. #define LEAVE_DATA                5
  53. #define ATTEMPT_RIGHT            6
  54.  
  55. /* errors */
  56.  
  57. #define OK                       0
  58. #define OUT_OF_MEMORY           -1
  59. #define CANT_OPEN               -2
  60. #define BAD_SEEK                -3
  61. #define BAD_READ                -4
  62. #define NOT_ACTIVE              -5
  63. #define BAD_RECORD              -6
  64. #define TOO_MANY_FIELDS         -7
  65. #define NO_MORE_FIELDS          -8
  66. #define BAD_STRING                -9
  67. #define BAD_FIELD_TYPE            -10
  68. #define NO_SUCH_WAY                -11
  69. #define WRONG_FIELD_NUMBER        -12
  70. #define PROTECTED_RECORD        -13
  71. #define BAD_WRITE                -14
  72. #define NO_WRITE_PERMISSION        -15
  73. #define NO_BRANCH                -16
  74. #define NO_NORMAL_REC            -17
  75. #define ALREADY_DATA            -18
  76. #define NO_DATA_FIELDS            -19
  77. #define BRANCH_EXISTS            -20
  78. #define NOT_FOUND                -21
  79. #define LABEL_OVERFLOW            -22
  80. #define BAD_SEQ                    -23
  81. #define SORT_TOO_MUCH            -24
  82. #define NO_LINK                    -25
  83. #define NO_MARK                    -26
  84. #define MANY_LINKS                -27
  85. #define WRONG_REC_ORDER            -28
  86. #define PROTECTED_BRANCH        -29
  87. #define DESCRIPTOR_NOT_FOUND    -30
  88. #define PROTECTED_RIGHT            -31
  89. #define ALREADY_DELETED            -32
  90.  
  91. #define MAXERR                    32
  92.  
  93. typedef union par {
  94.     short int   w;
  95.     short int   m;
  96.     long int    l;
  97.     float       f;
  98.     double      d;
  99.     long int    p;
  100.     char        *s;
  101. } PAR, *PPAR;
  102.  
  103. typedef struct {
  104.     char *s;                                /* file name */
  105. #ifdef MAC
  106.     short vRefNum;                            /* Volume Reference # (only for MAC) */
  107.     long parID;                                /* directory ID (only for MAC) */
  108.     unsigned long creator;                    /* creator only for hdscreat */
  109. #endif
  110. } FILESPEC;
  111.  
  112. typedef int (*HDS_func) (void);                /* pointer to functions used in traversals */
  113.  
  114. #include "hdsopen.h"
  115. #include "hdsinq.h"
  116. #include "hdsinse.h"
  117. #include "hdsmisc.h"
  118. #include "hdsnav.h"
  119. #include "hdssrch.h"
  120. #include "hdsinout.h"
  121. #include "hdslink.h"
  122.  
  123. #ifdef MAC
  124. #include "hdsmac.h"
  125. #include "hdserrors.h"
  126. #endif
  127.  
  128.